<?php
session_start();
include_once $_SERVER['DOCUMENT_ROOT']."/math-videos/configure.inc.php";
$asset_id = isset($_REQUEST['asset_id']) ? $_REQUEST['asset_id'] : '';
if(isset($_GET['tab_id']))
{
	$tab_id = $_GET['tab_id'];
}
elseif(isset($_POST['tab_id']))
{
	$tab_id = $_POST['tab_id'];
}
else
	$tab_id = 1;
$asset_area ='';
$presenter_area ='';
$keyword_area ='';
$timecode_area ='';
$msc_area ='';
$docs_area ='';

if($tab_id == 1) 
	require $_SERVER['DOCUMENT_ROOT'] . "/math-videos/admin/modules/add_edit_asset.php";
elseif($tab_id == 2) 
	require $_SERVER['DOCUMENT_ROOT'] . "/math-videos/admin/modules/add_edit_presenters.php";
elseif($tab_id == 3) 
	require $_SERVER['DOCUMENT_ROOT'] . "/math-videos/admin/modules/add_edit_keywords.php";
elseif($tab_id == 4) 
	require $_SERVER['DOCUMENT_ROOT'] . "/math-videos/admin/modules/add_edit_timecode.php";
elseif($tab_id == 5) 
	require $_SERVER['DOCUMENT_ROOT'] . "/math-videos/admin/modules/add_edit_msc.php";
elseif($tab_id == 6) 
	require $_SERVER['DOCUMENT_ROOT'] . "/math-videos/admin/modules/add_edit_docs.php";
$heading_area = $null;
$heading_area .= "<div style=\"font-family:Arial, Verdana, sans-serif; font-size : 12px;width:100%;padding-bottom:1px;\">";

$heading_area .= "<TABLE CELLPADDING=2 CELLSPACING=0 style=\"font-family:Arial, Verdana, sans-serif; font-size : 12px; color:white; background-color:#0099CC;width:100%;\" >";
$heading_area .= "<tr >
										<td colspan=2  align=\"right\" style=\"padding-right:20px;font-weight:bold;font-size : 12px;\"> <a href='logout.php' style=\"color:#fff;text-decoration:none;\" >Logout</a>
										</td>
									</tr>";  
$heading_area .= "<tr >
										<td colspan=2 align=\"center\" style=\"font-size:26px;\"> Math Video Add/Edit Asset
										</td>
									</tr>";  
// put out blue row to hold action buttons (add, cancel, delete, etc.)
$heading_area .= "
		<tr>
			<td colspan=2 align=\"center\" ><a href='".$site_http."admin/' style=\"color:#fff;font-size : 12px;font-weight:bold;\"> < Admin Home Page</a>";
$heading_area .= "</td>";
	
$heading_area .= "</tr>
	</TABLE></div>";
$data_area = $null;
$data_area .= "<div class=\"TabView\" id=\"myTabView\">
			<div class=\"Tabs\">
				<a ";
if($asset_id=='')
{
	if($tab_id == 1) 
		$data_area .="class=\"Current\""; 

		$data_area .=" href=\"maintenance.php?tab_id=1&amp;asset_id=$asset_id\"";
		$data_area .= ">Asset</a>";
}
else
{
	if($tab_id == 1) 
		$data_area .="class=\"Current\""; 

	$data_area .=" href=\"maintenance.php?tab_id=1&amp;asset_id=$asset_id\"";
	$data_area .= ">Asset</a>
	 <a ";
	if($tab_id == 2) 
		$data_area .="class=\"Current\""; 
 
	$data_area .=" href=\"maintenance.php?tab_id=2&amp;asset_id=$asset_id\"";
	$data_area .= ">Presenters</a>
<a ";
	if($tab_id == 3) 
		$data_area .="class=\"Current\""; 

	$data_area .=" href=\"maintenance.php?tab_id=3&amp;asset_id=$asset_id\"";
	$data_area .= ">Keywords</a>
		<a ";
	if($tab_id == 4) 
		$data_area .="class=\"Current\""; 
//	else 
	$data_area .=" href=\"maintenance.php?tab_id=4&amp;asset_id=$asset_id\"";
	$data_area .= ">Timecode</a>
	<a ";
	
	if($tab_id == 5) 
		$data_area .="class=\"Current\""; 
//	else 
	$data_area .=" href=\"maintenance.php?tab_id=5&amp;asset_id=$asset_id\"";
	$data_area .= ">MSC Number</a>
	<a ";
	
	if($tab_id == 6) 
		$data_area .="class=\"Current\""; 
	$data_area .=" href=\"maintenance.php?tab_id=6&amp;asset_id=$asset_id\"";
	$data_area .= ">Documents</a>";
}
$data_area .= "</div>";
$data_area .= "<div class=\"Pages\" >
			<div class=\"Page\" style=\"display:";
if($asset_id=='')
{
			if($tab_id == 1)
			$data_area .="block";
			else
			$data_area .="none";
			$data_area .="\">
				<div class=\"Pad\"> $asset_area</div>
			</div>";
}
else
{
			
			if($tab_id == 1)
			$data_area .="block";
			else
			$data_area .="none";
			$data_area .="\">
				<div class=\"Pad\"> $asset_area</div>
			</div>";
			$data_area .="<div class=\"Page\" style=\"display:";
			if($tab_id == 2)
			$data_area .="block";
			else
			$data_area .="none";
			$data_area .="\">
				<div class=\"Pad\"> $presenter_area</div>
			</div>";
			$data_area .="<div class=\"Page\" style=\"display:";
			if($tab_id == 3)
			$data_area .="block";
			else
			$data_area .="none";
			$data_area .="\">
				<div class=\"Pad\"> $keyword_area</div>
			
			</div>";
			
			$data_area .="<div class=\"Page\" style=\"display:";
			
			if($tab_id == 4)
			$data_area .="block";
			else
			$data_area .="none";
			$data_area .="\">
				<div class=\"Pad\"> $timecode_area</div>
			</div>";
			$data_area .="<div class=\"Page\" style=\"display:";
			
			if($tab_id == 5)
			$data_area .="block";
			else
			$data_area .="none";
			$data_area .="\">
				<div class=\"Pad\"> $msc_area</div>
			</div>";
			$data_area .="<div class=\"Page\" style=\"display:";
		
			if($tab_id == 6)
			$data_area .="block";
			else
			$data_area .="none";
			$data_area .="\">
				<div class=\"Pad\"> $docs_area</div>
			</div>";
}
$data_area .= "</div>

	</div>";
print "
    <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
		<html xmlns=\"http://www.w3.org/1999/xhtml\">
		<head>
		<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />
    <TITLE>Math Video Maintenance</TITLE>
		<link rel=\"stylesheet\" type=\"text/css\" href=\"".$site_http."styles/style.css\" />
   ";
print "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$site_http."styles/tab_view.css\" />";  // fortab
print "
 <link type=\"text/css\" href=\"../../../includes/jquery/css/redmond/jquery-ui-1.7.1.custom.css\" rel=\"stylesheet\" />	
	<script type=\"text/javascript\" src=\"../../../includes/jquery/js/jquery-1.3.2.min.js\"></script>
	<script type=\"text/javascript\" src=\"../../../includes/jquery/js/jquery-ui-1.7.1.custom.min.js\"></script>
	<script type=\"text/javascript\">
	$(function(){
	$('#datepicker1').datepicker({
			yearRange: \"-80:+10\",
		changeMonth: true,
		changeYear:  true
	});
});

</script>";
 print "
	</HEAD>
	<body>";
	
print "<div style=\"margin:0px;width:100%;\">";
print "
	<FORM  ACTION=\"\" METHOD=\"post\" enctype=\"multipart/form-data\" >";

// heading area
print $heading_area;
//if($selected_emp_id !=$null)
//{
	print $data_area;
//	}
// alert message if needed
if($alert_message != "") 
{
	$alert_message = str_replace('"', '\"', $alert_message);  // in case we have " in the $alert_message;
	$alert_message = str_replace("'", "\'", $alert_message);  // in case we have ' in the $alert_message;
	print "<script type=\"text/javascript\">alert(\"" . $alert_message . "\")</script>";
}
print "
	</FORM>
	 </div>
";
include "footer.php";
?>